package com.guan.study.easyExcelDemo.utils;


import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.alibaba.excel.util.StringUtils;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;


/**
 * @Date: 2023/7/20 10:32
 * @Author: yaobai
 * @Description: 数值转换器
 */
public class CustomConverter2 implements Converter<Boolean> {

    @Override
    public WriteCellData<?> convertToExcelData(Boolean value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {

        if (value){
            return new WriteCellData<>("是");
        }
        return new WriteCellData<>("否");
    }
    
}
